PcKey v1.01 is Copyright 1991-1993 Andrew Sprott. All rights reserved.
Welcome to PcKey. Here is a short description of the files on this disk that are part of the PcKey package:
PCKEY.COM The typing tutor program
PCKEY.DOC This document
PCKEY.HIS Release history for this and previous versions of PcKey
PCKEY.PJT PcWord project file for the documentation
PCKEY.SCR Root script file for the PcKey tutorial
WELCOME.SCR PcKey tutorial script files
INTRO.SCR
HOMEKEYS.SCR
KEYSUP.SCR
KEYSDOWN.SCR
ALLKEYS.SCR
SYMKEYS.SCR
MORE.SCR
PROGRESS.SCR
REPEAT.SCR
SAVE.SCR
WAITSPC.SCR
DOTEST1.SCR
DOTEST2.SCR
DOTEST3.SCR
DOTEST4.SCR
EX_MENU.SCR
EXSIZE1.SCR
EXSIZE2.SCR
EXSIZE3.SCR
EXSIZE4.SCR
EXSIZE5.SCR
SOFAR.SCR
STSPEED.SCR
TUTOR.BAT Batch file to run PcKey
* * *
Registration
I am distributing PcKey separately from PcWord and I am selling it for 15 pounds. If you have evaluated PcKey in the 30 day trial period, and you wish to use it further then please register PcKey by sending me 15 Pounds Sterling to the following address
Andrew Sprott
61 Bryn y mor
Three Crosses
Gower
Swansea SA4 3PE
UK
or, if you live in America, send 25 US Dollars to:
Eoin Sprott
Apartment 526,
Rivercross,
531 Main Street,
Roosevelt Island,
New York NY 10044
You are welcome to distribute copies of this package provided it is unaltered. But you are also welcome to distribute any additional script files you have created yourself.
* * *
PcKey
Using PcKey is relatively simple. First enter
TUTOR
at the command line.
When inside PcKey you basically have two options: The Tutorial or the Editor. To try the tutorial press 1. Everything is explained inside the tutorial and you should find no problems getting started.
Once you have got used to the exercises. You might like to try the editor. You can go into the editor by pressing 2 at the main menu. To return to the main menu from anywhere inside PcKey press ESC. ESC is short for ESCape.
The editor inside PcKey works very much the same as your average word processor but without the advanced features. You move the cursor - the flashing block - with the cursor keys. The cursor keys are the keys marked with arrows. They will be on the numeric keypad, and also with the newer keyboards, on a separate cluster of keys inbetween the numeric keypad and the main keyboard.
Other keys to use are:
HOME Move cursor to start of row.
END Move cursor to end of row.
Page_Up or PgUp Move cursor one page back.
Page_Down or PgDn Move cursor one page forward.
CTRL-Page_Up Move cursor to start of text.
CTRL-Page_down Move cursor to end of text.
TAB Move cursor to next tab stop.
ENTER Terminate current paragraph.
For a more thorough explanation of word processing, see the documentation for PcWord.
The PcKey script commands reference
PcKey is a typing tutor with a tutorial that consists of text - or 'script' - files that are read from disk and executed like a program. The instructions - or `commands' - in each script file perform certain simple tasks like printing words and messages on the screen or reading and setting `variables' that indicate how fast you are typing and what level of accuracy to set the pass rate and so on.
Most commands also have "arguments" that are either text messages or numerical values or even single characters. For example, the CURSOR command needs to know what row and column to position the cursor, and the PRINT command needs to know what text to display on the screen.
All screen coordinates used by the CURSOR, CLEAR, SCROLL and KEYBOARD commands start at 0 and end at 79 columns and 24 rows. Any arguments enclosed in brackets [] are optional, if they are omitted then the default for that argument is assumed. All commands, operators (see the IF command) and arguments should be separated by a space. Where SET is indicated as the argument, SET is 1 of 3. A set consists of data like the typists speed, accuracy and mistakes, as well as a user configuration variable which can be used for recording what the typist was last doing when he or she exited from the typing tutor.
Each command should be at the start of a line, and can be upper or lower case. All of the files with the .SCR extension, ie. PCKEY.SCR are script files. They can be TYPEd at the DOS prompt or loaded into any text editor, including the built in editor. By looking at these files you will see how the script language works.
CLEAR [ start_line [ end_line ] ]
Clear the screen, if end_line is omitted then line 24 is assumed, if start_line is omitted then line 0 is assumed. The cursor position will be set at the start of the first line cleared.
CURSOR column row
Position the cursor for any subsequent printing or typing.
PRINT ['] text
Output text to screen, the text can only fit on one line. A leading single quote will be ignored, this allows for any leading whitespace to be included as part of the text.
ENTER
Output carriage return marker to screen
SCROLL [ lines [ start_line [ end_line ] ]
This will scroll the screen, if end_line is omitted then line 24 is assumed, if start_line is omitted then line 0 is assumed and if lines is omitted then screen will scroll one line.
AUTO
Toggle auto increment/decrement of typing rate. If AUTO is on then the accuracy of the typist is checked every 20 seconds, if it is equal or higher than PASS then the typing rate will increase by 1 word per minute. If it is below FAIL then the typing rate will slow down. You can check if AUTO is on by checking to see if it is zero or not. For example if you want to ensure it is off then use the following line
IF AUTO ! 0 AUTO
If AUTO is 0 then auto increment/decrement is off, else it is on.
FAIL low_threshold
If accuracy falls below low_threshold and auto is on then typing rate goes down. The default is 35%.
PASS high_threshold
If accuracy is above high_threshold and auto is on then typing rate goes up. The default is 90%.
START set
Resets timers and counters in one of 3 sets.
ACCURACY set
Accuracy of set (1 of 3) will be displayed at cursor position
SPEED rate
Set speed in words per minute, if 0 then no timeout will occur. When this command is set at a non zero speed, the interval timeout has to be approximated. The actual speed in words per minute in real time may vary depending on how slow your machine is. This is because there is no way PcKey can determine how fast it may take to highlight - and unhighlight - keys on the displayed keyboard.
WORDS set
Displays speed of set in words per minute.
MISTAKES set
Displays number of mistakes in set.
MEMORY set = constant
User variables; these can be used to record the last lesson or whatever the user was doing the last time he or she finished.
SAVE [filename]
Save user variables to file on disk. If there is an error opening or writing the file then the tutorial will abort and an error message will be issued. If no filename is specified then either the filename passed to PcKey from the command line, or the default filename "PCKEY.SAV" will be assumed. If a filename is given without an extension, then the extension ".SAV" is assumed.
LOAD [-] [filename]
Read user variables from file on disk. If the "-" argument is present, and there is an error opening the file then the tutorial will abort and an error message will be issued; Otherwise, if the error "file not found" occurs and the "-" argument is not present then the filename specified - if there is one - will be set as the default filename, the user variables - MISTAKES, MEMORY etc. - will be set to 0 and the tutorial will continue execution with the next command. If a filename is given without an extension, then the extension ".SAV" is assumed.
WAIT [-]
Waits for keypress. The ASCII code for the key pressed is returned in KEY. If the "-" argument is included and ESC is pressed then the current script file will terminate and return to the previous level.
SCAN
Scan keyboard for state of ALT, CTRL, SHIFT, CAPS LOCK, SCROLL LOCK, NUM LOCK and the INSert keys. Use the SHIFT command to determine what keys are down.
SHIFT [ template 0 - 15 ]
Will return the state of the ALT, CTRL, SHIFT, SCROLL LOCK, NUM LOCK, CAPS LOCK, and INSert keys since the last call to SCAN or WAIT. The state of the bits in the value returned reflect which keys were down on the last call. If the optional template is included then it will be AND'ed with the bits returned.
Right SHIFT key = 1 (bit 0)
Left SHIFT key = 2 (bit 1)
CTRL key = 4 (bit 2)
ALT key = 8 (bit 3)
SCROLL LOCK key = 16 (bit 4)
NUM LOCK key = 32 (bit 5)
CAPS LOCK key = 64 (bit 6)
INSert key = 128 (bit 7)
If you think of each constant above as multiples of two, it becomes easier to understand. Like in decimal, you could assign each key a multiple of 10, so the right SHIFT key would equal 1, the left SHIFT key 10, the CTRL key 100 and so on. Therefore if you wanted to check for the left SHIFT key you would set the template to equal 10 and if you want to check for the CTRL key you would set template at 100. If you want to check if ONLY the left SHIFT key is down you would want to isolate both SHIFT keys from any other keys that may be down as well by setting the template at 11, and then check that the right SHIFT key is not down by checking if the result is 10. So, returning to multiples of 2 (binary), say that both SHIFT keys and the CAPS LOCK are down, then the SHIFT command will return the value 67 (1 for RIGHT shift + 2 for LEFT shift + 64 for CAPS LOCK.)
IF SHIFT 3 = 1 PRINT The only shift key down is the right shift key
SHIFT will return 67, the template 3 will isolate bits 0 and 1 ((bit 0 = 1) + (bit 1 = 2) = 3) and return 3, so the PRINT command will not be executed.
TEST [-]
If the cursor is positioned over a line of text then the typing tutor will commence at the cursor position and finish when the escape key is pressed or if it gets to the end of the line. If the "-" argument is included and ESC is pressed then the current script file will terminate and return to the previous level.
KEYBOARD [ start_line ]
Display keyboard starting at start_line or at line 0 if start_line is omitted.
FKEY < ['] character > or < key ASCII constant >
If the keyboard is displayed then the key of character will be drawn in the foreground colour. A leading single quote will be ignored. NOTE if the first non space character in the argument is a digit then a leading single quote will distinquish it from being an ASCII constant. The ASCII constant is included for the ENTER, BACKSPACE, TAB and left/right SHIFT keys. The codes for these keys are
Right SHIFT 1 Left SHIFT 2 BACKSPACE 8 TAB 9 ENTER 13
BKEY < ['] character > or < key ASCII constant >
If the keyboard is displayed then the key of character will be drawn in the background colour. A leading single quote will be ignored. NOTE if the first non space character in the argument is a digit then a leading single quote will distinquish it from being an ASCII constant. The ASCII constant is included for the ENTER, BACKSPACE, TAB and left/right SHIFT keys.
HKEY < ['] character > or < key ASCII constant >
If the keyboard is displayed then the key of character will be highlighted. A leading single quote will be ignored. NOTE if the first non space character in the argument is a digit then a leading single quote will distinquish it from being an ASCII constant. The ASCII constant is included for the ENTER, BACKSPACE, TAB and left/right SHIFT keys.
HAREA ['] character
If the keyboard is displayed then the finger area of the key of character will be highlighted. A leading single quote will be ignored.
UAREA ['] character
If the keyboard is displayed then the finger area of the key of character will be unhighlighted. A leading single quote will be ignored.
KEY
This command will return the ASCII character of the last key pressed. The code for the ESCape key is 27, TAB key 9, ENTER key 13.
IF expr1 operator expr2 statement
EXPR1 can be one of the following commands
AUTO
FAIL
PASS
ACCURACY set
SPEED
WORDS set
MISTAKES set
MEMORY set
KEY
SHIFT [template]
OPERATOR can be one of the following symbols
= Equal to
! Not equal to
< Smaller than
<= Smaller or equal to
> Greater than
>= Greater or equal to
EXPR2 can be any of the commands in EXPR1 or a constant value ie. 1 or 48.
If EXPR1 evaluates to EXPR2 then STATEMENT will be executed else it will be ignored. STATEMENT can also be another IF command.
GOTO label
This command forces execution to start at the command following LABEL which is a "named" location in the script file. PcKey distinguishes a label from a command with a colon : prefixed at the start of the LABEL. For example in this script file
:wait_for_key
wait
if key = 27 goto exit
goto wait_for_key
:exit
...
after a key has been pressed and it is ESCape - the code for ESC is 27 - then execution will transfer to the command following the LABEL :exit. Otherwise execution will transfer to the WAIT command following the LABEL :wait_for_key.
SCRIPT [-] filename
If filename exists then the script file will be loaded and executed. When it is finished then execution continues with the calling script file. Up to 32 script files can be nested. If the optional "-" is included as the first argument, and the last keypress was ESCape, then the calling script file will fall through as well. For example, this script
clear
keyboard
script - script2
...
:exit
is equivalent to
clear
keyboard
script script2
if key = 27 goto exit
...
:exit
If no extension is included in the filename of the script file then the default extension ".SCR" will be assumed.
THE BUILT IN EDITOR.
The editor is designed to move you away from the tutorial to a typical word-processor/text-editor environment. The features are very basic, but serve as an introduction to text entry.
If you are new to text processing then you will need to understand simple concepts, the most general being the 'cursor'. You will notice the cursor flashing on and off somewhere in the screen display. It generally covers one character.
Think of the cursor as the pen in your hand when you are writing. Whenever you enter any text from the keyboard, that text will be written to your document at the point where the cursor is. The same applies to your plain simple DOS prompt.
There are other keypresses that will move the cursor to any other part of your document that you may be editing. The keys that I interpret for the functions are basically standard and are as follows:
The four arrow keys - or cursor keys - are marked with arrows, up/down/left/right. They will always be situated on the numeric keypad over the 8/2/4/6 keys respectively. They will also appear on the newer keyboards as a small cluster of keys inbetween the main keyboard and numeric keypad.
These keys move the cursor in the direction of the arrow:
UP_CURSOR_KEY: Move the cursor up one row. If the cursor is on the top displayed row of your text ie. at the top of the screen, then your text will 'scroll', that is, every row bar the bottom row, will move down a row and another row of text will be read from your document and displayed on the top row.
DOWN_CURSOR_KEY: Move the cursor down one row. If the cursor is on the bottom displayed row of your text ie. at the bottom of the screen, then your text will 'scroll', that is, every row bar the bottom row, will move up a row and another row of text will be read from your document and displayed on the bottom row.
LEFT_CURSOR_KEY: Move the cursor left one character. If the cursor is at the first character of a row - the left margin - then the cursor will move by the last character of the next row up.
RIGHT_CURSOR_KEY: Move the cursor right one character. If the cursor is at the the right margin of your document then the cursor will move by the first character of the next row down.
There are other keys used for editing and are also situated on the numeric keypad and as a seperate cluster of keys. Two are called 'HOME' and 'END' which are used to move the cursor to the START/END of the row that the cursor is on. That is, the HOME key will move the cursor to the first character of the cursor row - the left margin - and the END key will move the cursor to the right of the last character in the row.
The PgUp and PgDn keys mean 'Page Up' and 'Page Down' respectively. Think of the text displayed - on the screen - as a 'window' to your document. Naturally, as you add more text to your document, it will outgrow the space allocated on the screen to display your work.
So even though your text starts to dissapear at the top of the screen as you are typing, it isn't actually lost; it is stored in memory. So it can be redisplayed by either pressing the up cursor key, making the window scroll, or by using PgUp or PgDn.
Using PgUp or Page Up, will display the previous window-full of text to the screen. And the PgDn, or Page Down key will display the next window-full of text. You can press these keys until you get to the start/end of your document.
COMMAND LINE INVOCATION.
PcKey will recognise 3 command line arguments
/s <script_filename>
If this is included in the command line then PcKey will not prompt for a script filename when the tutor option is selected from the main menu, but will use the filename passed from the command line. NOTE, the path to the script file will be also adopted for any other scripts loaded.
/e <editor_filename>
If this is included in the command line then PcKey will not prompt for an editor filename when the editor option is selected from the main menu, but will use the filename passed from the command line.
/m <save_filename>
If the commands LOAD and SAVE are used from within a script file and no filename is given, then the default filename "PCKEY.SAV" or the filename passed from the command line will be assumed.